import java.util.Scanner;

public class Text1 {
    public static int maxfunc(int x1,int x2){
        int tmp = x2;
        while(x1%x2!=0){
            tmp = x1 % x2;
            x1 = x2;
            x2 = tmp;
        }
        return tmp;
    }

    public static void func (int[] array,int a){
        for (int i = 0; i < array.length; i++) {
            if (array[i]<=a){
                a+=array[i];
            } else {
                a+=maxfunc(array[i],a);
            }
        }
        System.out.println(a);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = 0,a = 0;
        int[] array;
        while(sc.hasNext()){
            n = sc.nextInt();
            a = sc.nextInt();
            array = new int[n];
            for (int i=0;i<n;i++){
                array[i] = sc.nextInt();
            }

            func(array,a);
        }
    }
}
